Skip to content

🎨 Palette: setup wizard keeps focus when a connect button is redrawn - #369

Merged
Randomname653 merged 1 commit into
mainfrom
palette/setup-connect-focus
Nov 28, 2026
Merged

Randomname653 merged 1 commit into
mainfrom
palette/setup-connect-focus

Conversation

@Randomname653

Copy link
Copy Markdown
Owner

Problem

Three wizard actions redraw the whole step and replace the control the keyboard user just pressed, so focus falls to <body> (WCAG 2.4.3 Focus Order): "Sign in with Plex" (startPlexConnect), "Use another Plex account" (plexConnectAgain) and Jellyfin "Connect another server" (jellyfinConnectAgain). Keyboard users must Tab from the top of the page again.

Evidence (Playwright, static server + mocked /api, calling the handlers with focus on the pressed control): document.activeElement after each = BODY, BODY, BODY.

Change

After the redraw, focus the control that took its place: #plex-connect-btn (twice) and #s-jellyfin-url. 3 lines in frontend/js/setup.js.

Measured effect / proof

Same probe after the change: BUTTON#plex-connect-btn, BUTTON#plex-connect-btn, INPUT#s-jellyfin-url.

Tests

tests/test_a11y_nav.py::test_setup_connect_redraws_keep_focus runs the three real functions in node with fakes (focus only counts after the redraw). Before: 3 failed. After: 42 passed, 0 failed. Full battery: 356/357; the only failure is the known sandbox-only test_enrichment_status_perf.py (SQLite planner), which fails identically on untouched main.

Risk & edge cases

Optional chaining, so no-op if the element is absent. Focus is only moved in handlers triggered by a user press. Plex poll completion/expiry redraws are untouched (focus is in the plex.tv tab then). No new text, no i18n changes.

Duplicate check

Searched open/closed PRs (focus setup plex), the last 300 commits, and the Palette journal. Related: #354 (radios) and #361 (Next/Back) are different handlers.


Generated by Claude Code

@Randomname653 Randomname653 mentioned this pull request Nov 28, 2026
@Randomname653
Randomname653 merged commit 2daf11c into main Nov 28, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants